import { createApp } from 'vue'
// import './style.css'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import router from './router/index';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {createPinia} from 'pinia';
// 进度条+路由守卫
import './per'
// 引入图片懒加载文件
import imgLazy from '@/directive/index'

const app = createApp(App);
const pinia = createPinia()
// 全局注册图片懒加载
imgLazy(app)
// 注册所有icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
    .use(router)
    .use(ElementPlus, {
        locale: zhCn,})
    .mount('#app')
